import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

export type DogDocument = Dog & Document;

@Schema()
export class Dog {
  @Prop({ required: true })
  name: string;

  @Prop()
  sex: 'male' | 'female';

  @Prop()
  age: number;

  @Prop({ default: Date.now })
  createdAt: Date;
}

// 创建Schema
export const DogSchema = SchemaFactory.createForClass(Dog);
